//
//  AssetItem.swift
//  Media
//
//  Created by han on 2021/6/8.
//

import UIKit
import Photos

enum AssetType {
    case image
    case audio
    case video
    case unowned
}

enum AssetSubType {
    case image
    case livePhoto
    case GIF
    case unowned
}

enum AssetDownloadStatus {
    case succeed
    case failed
    case downloading
    case canceled
}

// 相册里某一个资源的包装对象，该资源可能是图片、视频等
class AssetItem: NSObject {
    private(set) var assetType: AssetType = .unowned
    private(set) var assetSubType: AssetType = .unowned
    private(set) var downloadStatus: AssetDownloadStatus = .canceled
    
    private(set) var asset: PHAsset
    
    var downloadProgress: Double = 0 // 从 iCloud 下载资源大图的进度
    var requestID: Int? // 从 iCloud 请求获得资源的大图的请求 ID
   
    private(set) var identifier: String?
    
    init(_ asset: PHAsset) {
        self.asset = asset
        super.init()
    }
    
}
